import request from '@/utils/request'

// 查询婚恋人员信息列表
export function listMember(query) {
  return request({
    url: '/dating/member/list',
    method: 'get',
    params: query
  })
}

// 查询婚恋人员信息详细
export function getMember(memberId) {
  return request({
    url: '/dating/member/' + memberId,
    method: 'get'
  })
}

// 新增婚恋人员信息
export function addMember(data) {
  return request({
    url: '/dating/member',
    method: 'post',
    data: data
  })
}

// 修改婚恋人员信息
export function updateMember(data) {
  return request({
    url: '/dating/member',
    method: 'put',
    data: data
  })
}

// 删除婚恋人员信息
export function delMember(memberIds) {
  return request({
    url: '/dating/member/' + memberIds,
    method: 'delete'
  })
}

// 校验人员编号是否唯一
export function checkMemberNoUnique(memberNo, memberId) {
  return request({
    url: '/dating/member/checkMemberNoUnique',
    method: 'get',
    params: {
      memberNo: memberNo,
      memberId: memberId
    }
  })
}

// 校验手机号码是否唯一
export function checkPhoneUnique(phone, memberId) {
  return request({
    url: '/dating/member/checkPhoneUnique',
    method: 'get',
    params: {
      phone: phone,
      memberId: memberId
    }
  })
}

// 获取婚恋人员统计数据
export function getMemberStatistics() {
  return request({
    url: '/dating/member/statistics',
    method: 'get'
  })
}

// 获取每日新增人员统计
export function getDailyMemberGrowth(days = 30) {
  return request({
    url: '/dating/member/dailyGrowth',
    method: 'get',
    params: {
      days: days
    }
  })
}

// 获取性别分布统计
export function getGenderDistribution() {
  return request({
    url: '/dating/member/genderDistribution',
    method: 'get'
  })
}

// 获取年龄分布统计
export function getAgeDistribution() {
  return request({
    url: '/dating/member/ageDistribution',
    method: 'get'
  })
}

// 获取收入分布统计
export function getIncomeDistribution() {
  return request({
    url: '/dating/member/incomeDistribution',
    method: 'get'
  })
} 